package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.KnowlledgepointMapper;
import com.education.wisdom.pojo.Knowlledgepoint;
import com.education.wisdom.service.IKnowlledgepointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 知识点 服务层实现
 * 
 * @author ruoyi
 * @date 2018-10-30
 */
@Service
public class KnowlledgepointServiceImpl implements IKnowlledgepointService
{
	@Autowired
	private KnowlledgepointMapper knowlledgepointMapper;

	/**
     * 查询知识点信息
     * 
     * @param knowledgeCode 知识点ID
     * @return 知识点信息
     */
    @Override
	public Knowlledgepoint selectKnowlledgepointById(String knowledgeCode)
	{
	    return knowlledgepointMapper.selectKnowlledgepointById(knowledgeCode);
	}
	
	/**
     * 查询知识点列表
     * 
     * @param knowlledgepoint 知识点信息
     * @return 知识点集合
     */
	@Override
	public List<Knowlledgepoint> selectKnowlledgepointList(Knowlledgepoint knowlledgepoint)
	{
	    return knowlledgepointMapper.selectKnowlledgepointList(knowlledgepoint);
	}
	
    /**
     * 新增知识点
     * 
     * @param knowlledgepoint 知识点信息
     * @return 结果
     */
	@Override
	public int insertKnowlledgepoint(Knowlledgepoint knowlledgepoint)
	{
	    return knowlledgepointMapper.insertKnowlledgepoint(knowlledgepoint);
	}
	
	/**
     * 修改知识点
     * 
     * @param knowlledgepoint 知识点信息
     * @return 结果
     */
	@Override
	public int updateKnowlledgepoint(Knowlledgepoint knowlledgepoint)
	{
	    return knowlledgepointMapper.updateKnowlledgepoint(knowlledgepoint);
	}

	/**
     * 删除知识点对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteKnowlledgepointByIds(String ids)
	{
		return knowlledgepointMapper.deleteKnowlledgepointByIds(Convert.toStrArray(ids));
	}
	
}
